﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Rechargeable.Machines;
using Rechargeable.Products.Dtos;

namespace Rechargeable.Web.Pages.SerialNumber
{
    public class IndexModel : PageModel
    {

        private readonly IMachineAppService machineAppService;

        public List<ProductDto> Products { get; set; }

        public IndexModel(IMachineAppService _machineAppService)
        {
            machineAppService = _machineAppService;
        }

        public async Task OnGet()
        {
            Products = await machineAppService.GetUseProduct();
        }
    }
}